// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** addBook POST /api/book/add */
export async function addBookUsingPost(
  body: API.BookAddRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong_>('/api/book/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** deleteBook POST /api/book/delete */
export async function deleteBookUsingPost(
  body: API.DeleteRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/api/book/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** getBookById GET /api/book/get */
export async function getBookByIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getBookByIdUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBookVO>('/api/book/get', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** listBook GET /api/book/list */
export async function listBookUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listBookUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseListBookVO>('/api/book/list', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** listBookByPage GET /api/book/list/page */
export async function listBookByPageUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listBookByPageUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsePageBookVO>('/api/book/list/page', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** updateBook POST /api/book/update */
export async function updateBookUsingPost(
  body: API.BookUpdateRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/api/book/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
